﻿using System;
using System.Collections.Generic;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Himall.Entity.Config
{
    public class ShippingAddressInfoConfig : EntityTypeConfiguration<ShippingAddressInfo>
    {
        public ShippingAddressInfoConfig()
        {
            ToTable("Himall_ShippingAddresses");
            Property(item => item.Address).HasColumnType("varchar").HasMaxLength(200);
            Property(item => item.AddressDetail).HasColumnType("varchar").HasMaxLength(100);
            Property(item => item.ShipTo).HasColumnType("varchar").HasMaxLength(100);
            Property(item => item.Phone).HasColumnType("varchar").HasMaxLength(20);
            HasRequired(x => x.MemberInfo).WithMany(x => x.ShippingAddressInfo).HasForeignKey(x => x.UserId);
        }
    }
}
